package com.freshcity.page.help
{
	import com.freshcity.ILayer;
	import com.freshcity.component.container.Component;
	import com.freshcity.core.BaseHomeWin;
	import com.freshcity.help.HomeWin;
	import com.greensock.TweenMax;
	
	import fl.events.ListEvent;
	
	import flash.display.DisplayObjectContainer;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	public class HelpHome extends BaseHomeWin
	{
		private var back:HomeWin;
		
		public function HelpHome(parent:ILayer=null, xpos:Number=0, ypos:Number=0)
		{
			super(parent, xpos, ypos,"帮助");
			back.tabMenu.addEventListener(ListEvent.ITEM_CLICK, drawContent);
		}
		
		override protected function addChildren():void
		{
			super.addChildren();
			back = new HomeWin();
			addChild(back);
			container=back.container;
			container.mouseEnabled=false;
			container.tabEnabled=false;
			
			back.tabMenu.arrBtnLabels=["意见箱", "交友指南"];
		}
		
		override protected function initContent(index:int):void
		{
			var c:Component;
			switch (index)
			{
				case 0:
				{
					c=new UserQuestion();
					break;
				}
				case 1:
				{
					c=new GainWealthDesc();
					break;
				}
				default:
				{
					break;
				}
			}
			c.main=this.main;
			_contains[index]=c;
		}		
		
		override public function destroy():void
		{
			super.destroy();
		}
		
		override public function hide(event:Event=null):void
		{
			super.hide(event);
		}
		
		override public function show(event:Event=null):void
		{
			super.show(event);
			
			back.tabMenu.selectedIndex = 0;
			back.tabMenu.dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK, false, true, 0, 0, 0));
		}
	}
}